//引入handler模块
var handler = require("./handler.js");
//引入express模块
var express = require("express");
//创建router
var router = express.Router();
//设置router
router.get("/", handler.getIndexPage)
    .get("/add", handler.getAddPage)
    .post("/postupload", handler.postupload)
    .post("/add", handler.sendAddReq)
    .get("/edit", handler.getEditPage)
    .post("/edit", handler.sendEditReq)
    .get("/del", handler.sendDelReq)
    .get("/login", handler.getLoginPage)
    .post("/login", handler.sendLoginReq)
    .get("/register", handler.getRegisterPage)
    .post("/register", handler.sendRegisterReq);
//暴露外界使用
module.exports = router;